import LoginWork from '@/utils/LoginWork'

export interface LoginPort {
  loginName: string
  password: string
}

export interface LoginPortT {
  [x: string]: string
  token: string
}

export interface data {
  code: number
  data: LoginPortT
  message: string
}

//登录接口
export const LoginRegister = (parms: LoginPort) => {
  return LoginWork.post<any, data>(`/user/login`, parms)
}

// 用户权限
export const userMenu = () => {
  return LoginWork.post<any, any>(`/user/progQuery`)
}

// 注册接口
export const register = (parms: LoginPort) => {
  return LoginWork.post<any, data>(`/user/register`, parms)
}

// 获取验证码
export const getCodeImg = () => {
  return LoginWork.get<any, any>(`/user/getCodeImg`)
}
